package com.downloading.presentacionsamsung;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.AlphaAnimation;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class Portada extends Activity {

	ArrayList<Pulsado> pulsados = new ArrayList<Pulsado>();

	private AlphaAnimation alphaDown;
	private AlphaAnimation alphaUp;

	RelativeLayout mail_layout;
	ImageButton socialTV;
	Pulsado pulsadosocialTV;

	ImageButton cadena;
	Pulsado pulsadocadena;

	ImageButton recomendador;
	Pulsado pulsadorecomendador;

	ImageButton social;
	Pulsado pulsadosocial;
	ImageButton usuario;
	Pulsado pulsadousuario;

	ImageButton recomendacionGenerica;
	Pulsado pulsadorecomendacionGenerica;
	ImageView estrenos;
	Pulsado pulsadoestrenos;
	ImageView destacados;
	Pulsado pulsadodestacados;
	ImageView patrocinados;
	Pulsado pulsadopatrocinados;

	ImageButton analisisPatrones;
	Pulsado pulsadoanalisisPatrones;

	ImageButton recomendacionPersonalizadas;
	Pulsado pulsadorecomendacionPersonalizadas;
	ImageView estilo;
	Pulsado pulsadoestilo;
	ImageView costumbres;
	Pulsado pulsadocostumbres;

	ImageView emision;
	Pulsado pulsadoemision;
	ImageView checkIn;
	Pulsado pulsadocheckIn;

	ImageButton guiaTvProgramacion;
	Pulsado pulsadoguiaTvProgramacion;
	ImageView canalesFavoritos;
	Pulsado pulsadocanalesFavoritos;

	ImageButton programas;
	Pulsado pulsadoprogramas;
	ImageView informacion;
	Pulsado pulsadoinformacion;
	ImageView guiaCapitulos;
	Pulsado pulsadoguiaCapitulos;
	ImageView avances;
	Pulsado pulsadoavances;

	ImageButton gamification;
	Pulsado pulsadogamification;
	ImageView registroVisualizacionJuego;
	Pulsado pulsadoregistroVisualizacionJuego;
	ImageView nivelesPuntos;
	Pulsado pulsadonivelesPuntos;
	ImageView retos;
	Pulsado pulsadoretos;

	ImageView checkInUser;
	Pulsado pulsadocheckInUser;
	ImageView favoritos;
	Pulsado pulsadofavoritos;
	ImageView alarmas;
	Pulsado pulsadoalarmas;
	ImageView registroVisualizacion;
	Pulsado pulsadoregistroVisualizacion;

	ImageView geolocalizacion;
	Pulsado pulsadogeolocalizacion;
	ImageView circulosEmisionRecepcion;
	Pulsado pulsadocirculosEmisionRecepcion;

	ImageButton grupos;
	Pulsado pulsadogrupos;
	ImageButton tresNiveles;
	Pulsado pulsadotresNiveles;
	ImageView circulo;
	Pulsado pulsadocirculo;
	ImageView antena;
	Pulsado pulsadoantena;
	ImageView global;
	Pulsado pulsadoglobal;

	ImageView explicativo;
	Pulsado pulsadoexplicativo;
	TextView textExplicativo;
	Pulsado pulsadotextExplicativo;

	ImageView flecha1;
	ImageView flecha2;
	ImageView flecha3;
	ImageView flecha4;
	ImageView flecha5;
	ImageView flecha6;
	ImageView flecha7;
	ImageView flecha8;
	ImageView flecha9;
	ImageView flecha10;
	ImageView flecha11;
	ImageView flecha12;
	ImageView flecha13;
	ImageView flecha14;
	ImageView flecha15;
	ImageView flecha16;
	ImageView flecha17;
	ImageView flecha18;
	ImageView flecha19;
	ImageView flecha20;
	ImageView flecha21;
	ImageView flecha22;
	ImageView flecha23;
	ImageView flecha24;
	ImageView flecha25;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_portada);

		alphaDown = new AlphaAnimation(1.0f, 0.0f);
		alphaUp = new AlphaAnimation(0.0f, 1.0f);
		alphaDown.setDuration(500);
		alphaUp.setDuration(500);
		alphaDown.setFillAfter(true);
		alphaUp.setFillAfter(true);

	}

	@Override
	protected void onResume() {
		super.onResume();

		mail_layout = (RelativeLayout) findViewById(R.id.main_layout);

		socialTV = (ImageButton) findViewById(R.id.socialtv_image);
		socialTV.setOnClickListener(new socialTVClick());
		pulsadosocialTV = new Pulsado("socialTV", socialTV.getId());
		pulsados.add(pulsadosocialTV);

		cadena = (ImageButton) findViewById(R.id.cadena_image);
		cadena.setOnClickListener(new socialTVClick());
		cadena.setVisibility(View.INVISIBLE);
		pulsadocadena = new Pulsado("cadena", cadena.getId());
		pulsados.add(pulsadocadena);

		recomendador = (ImageButton) findViewById(R.id.recomendador_image);
		recomendador.setOnClickListener(new socialTVClick());
		recomendador.setVisibility(View.INVISIBLE);
		pulsadorecomendador = new Pulsado("recomendador", recomendador.getId());
		pulsados.add(pulsadorecomendador);

		social = (ImageButton) findViewById(R.id.social_image);
		social.setOnClickListener(new socialTVClick());
		social.setVisibility(View.INVISIBLE);
		pulsadosocial = new Pulsado("social", social.getId());
		pulsados.add(pulsadosocial);

		usuario = (ImageButton) findViewById(R.id.usuario_image);
		usuario.setOnClickListener(new socialTVClick());
		usuario.setVisibility(View.INVISIBLE);
		pulsadousuario = new Pulsado("usuario", usuario.getId());
		pulsados.add(pulsadousuario);

		recomendacionGenerica = (ImageButton) findViewById(R.id.recomendacion_generica_image);
		recomendacionGenerica.setOnClickListener(new socialTVClick());
		recomendacionGenerica.setVisibility(View.INVISIBLE);
		pulsadorecomendacionGenerica = new Pulsado("recomendacionGenerica",
				recomendacionGenerica.getId());
		pulsados.add(pulsadorecomendacionGenerica);

		estrenos = (ImageView) findViewById(R.id.estrenos_image);
		estrenos.setOnClickListener(new socialTVClick());
		estrenos.setVisibility(View.INVISIBLE);
		pulsadoestrenos = new Pulsado("estrenos", estrenos.getId());
		pulsados.add(pulsadoestrenos);

		destacados = (ImageView) findViewById(R.id.destacados_image);
		destacados.setOnClickListener(new socialTVClick());
		destacados.setVisibility(View.INVISIBLE);
		pulsadodestacados = new Pulsado("destacados", destacados.getId());
		pulsados.add(pulsadodestacados);

		patrocinados = (ImageView) findViewById(R.id.patrocinados_image);
		patrocinados.setOnClickListener(new socialTVClick());
		patrocinados.setVisibility(View.INVISIBLE);
		pulsadopatrocinados = new Pulsado("patrocinados", patrocinados.getId());
		pulsados.add(pulsadopatrocinados);

		analisisPatrones = (ImageButton) findViewById(R.id.analisis_patrones_image);
		analisisPatrones.setOnClickListener(new socialTVClick());
		analisisPatrones.setVisibility(View.INVISIBLE);
		pulsadoanalisisPatrones = new Pulsado("analisisPatrones",
				analisisPatrones.getId());
		pulsados.add(pulsadoanalisisPatrones);

		recomendacionPersonalizadas = (ImageButton) findViewById(R.id.recomendacion_personalizada_image);
		recomendacionPersonalizadas.setOnClickListener(new socialTVClick());
		recomendacionPersonalizadas.setVisibility(View.INVISIBLE);
		pulsadorecomendacionPersonalizadas = new Pulsado(
				"recomendacionPersonalizadas",
				recomendacionPersonalizadas.getId());
		pulsados.add(pulsadorecomendacionPersonalizadas);

		estilo = (ImageView) findViewById(R.id.estilo_imagen);
		estilo.setOnClickListener(new socialTVClick());
		estilo.setVisibility(View.INVISIBLE);
		pulsadoestilo = new Pulsado("estilo", estilo.getId());
		pulsados.add(pulsadoestilo);

		costumbres = (ImageView) findViewById(R.id.costumbres_usuarios_image);
		costumbres.setOnClickListener(new socialTVClick());
		costumbres.setVisibility(View.INVISIBLE);
		pulsadocostumbres = new Pulsado("costumbres", costumbres.getId());
		pulsados.add(pulsadocostumbres);

		emision = (ImageView) findViewById(R.id.emision_actual_image);
		emision.setOnClickListener(new socialTVClick());
		emision.setVisibility(View.INVISIBLE);
		pulsadoemision = new Pulsado("emision", emision.getId());
		pulsados.add(pulsadoemision);

		checkIn = (ImageView) findViewById(R.id.checkin_image);
		checkIn.setOnClickListener(new socialTVClick());
		checkIn.setVisibility(View.INVISIBLE);
		pulsadocheckIn = new Pulsado("checkIn", checkIn.getId());
		pulsados.add(pulsadocheckIn);

		guiaTvProgramacion = (ImageButton) findViewById(R.id.guiatv_programacion_image);
		guiaTvProgramacion.setOnClickListener(new socialTVClick());
		guiaTvProgramacion.setVisibility(View.INVISIBLE);
		pulsadoguiaTvProgramacion = new Pulsado("guiaTvProgramacion",
				guiaTvProgramacion.getId());
		pulsados.add(pulsadoguiaTvProgramacion);

		canalesFavoritos = (ImageView) findViewById(R.id.canales_favoritos_image);
		canalesFavoritos.setOnClickListener(new socialTVClick());
		canalesFavoritos.setVisibility(View.INVISIBLE);
		pulsadocanalesFavoritos = new Pulsado("canalesFavoritos",
				canalesFavoritos.getId());
		pulsados.add(pulsadocanalesFavoritos);

		programas = (ImageButton) findViewById(R.id.programas_image);
		programas.setOnClickListener(new socialTVClick());
		programas.setVisibility(View.INVISIBLE);
		pulsadoprogramas = new Pulsado("programas", programas.getId());
		pulsados.add(pulsadoprogramas);

		informacion = (ImageView) findViewById(R.id.informacion_image);
		informacion.setOnClickListener(new socialTVClick());
		informacion.setVisibility(View.INVISIBLE);
		pulsadoinformacion = new Pulsado("informacion", informacion.getId());
		pulsados.add(pulsadoinformacion);

		guiaCapitulos = (ImageView) findViewById(R.id.guia_capitulos_image);
		guiaCapitulos.setOnClickListener(new socialTVClick());
		guiaCapitulos.setVisibility(View.INVISIBLE);
		pulsadoguiaCapitulos = new Pulsado("guiaCapitulos",
				guiaCapitulos.getId());
		pulsados.add(pulsadoguiaCapitulos);

		avances = (ImageView) findViewById(R.id.contenidos_image);
		avances.setOnClickListener(new socialTVClick());
		avances.setVisibility(View.INVISIBLE);
		pulsadoavances = new Pulsado("avances", avances.getId());
		pulsados.add(pulsadoavances);

		gamification = (ImageButton) findViewById(R.id.gamification_image);
		gamification.setOnClickListener(new socialTVClick());
		gamification.setVisibility(View.INVISIBLE);
		pulsadogamification = new Pulsado("gamification", gamification.getId());
		pulsados.add(pulsadogamification);

		registroVisualizacionJuego = (ImageView) findViewById(R.id.registro_visualizacion_juego_image);
		registroVisualizacionJuego.setOnClickListener(new socialTVClick());
		registroVisualizacionJuego.setVisibility(View.INVISIBLE);
		pulsadoregistroVisualizacionJuego = new Pulsado(
				"registroVisualizacionJuego",
				registroVisualizacionJuego.getId());
		pulsados.add(pulsadoregistroVisualizacionJuego);

		retos = (ImageView) findViewById(R.id.retos_image);
		retos.setOnClickListener(new socialTVClick());
		retos.setVisibility(View.INVISIBLE);
		pulsadoretos = new Pulsado("retos", retos.getId());
		pulsados.add(pulsadoretos);

		nivelesPuntos = (ImageView) findViewById(R.id.puntos_niveles_image);
		nivelesPuntos.setOnClickListener(new socialTVClick());
		nivelesPuntos.setVisibility(View.INVISIBLE);
		pulsadonivelesPuntos = new Pulsado("nivelesPuntos",
				nivelesPuntos.getId());
		pulsados.add(pulsadonivelesPuntos);

		checkInUser = (ImageView) findViewById(R.id.check_in_user_image);
		checkInUser.setOnClickListener(new socialTVClick());
		checkInUser.setVisibility(View.INVISIBLE);
		pulsadocheckInUser = new Pulsado("checkInUser", checkInUser.getId());
		pulsados.add(pulsadocheckInUser);

		favoritos = (ImageView) findViewById(R.id.favorito_image);
		favoritos.setOnClickListener(new socialTVClick());
		favoritos.setVisibility(View.INVISIBLE);
		pulsadofavoritos = new Pulsado("favoritos", favoritos.getId());
		pulsados.add(pulsadofavoritos);

		alarmas = (ImageView) findViewById(R.id.alarmas_image);
		alarmas.setOnClickListener(new socialTVClick());
		alarmas.setVisibility(View.INVISIBLE);
		pulsadoalarmas = new Pulsado("alarmas", alarmas.getId());
		pulsados.add(pulsadoalarmas);

		registroVisualizacion = (ImageView) findViewById(R.id.registro_visualizacion_image);
		registroVisualizacion.setOnClickListener(new socialTVClick());
		registroVisualizacion.setVisibility(View.INVISIBLE);
		pulsadoregistroVisualizacion = new Pulsado("registroVisualizacion",
				registroVisualizacion.getId());
		pulsados.add(pulsadoregistroVisualizacion);

		geolocalizacion = (ImageView) findViewById(R.id.geolocalizacion_image);
		geolocalizacion.setOnClickListener(new socialTVClick());
		geolocalizacion.setVisibility(View.INVISIBLE);
		pulsadogeolocalizacion = new Pulsado("geolocalizacion",
				geolocalizacion.getId());
		pulsados.add(pulsadogeolocalizacion);

		circulosEmisionRecepcion = (ImageView) findViewById(R.id.circulos_emision_recepcion_image);
		circulosEmisionRecepcion.setOnClickListener(new socialTVClick());
		circulosEmisionRecepcion.setVisibility(View.INVISIBLE);
		pulsadocirculosEmisionRecepcion = new Pulsado(
				"circulosEmisionRecepcion", circulosEmisionRecepcion.getId());
		pulsados.add(pulsadocirculosEmisionRecepcion);

		grupos = (ImageButton) findViewById(R.id.grupos_image);
		grupos.setOnClickListener(new socialTVClick());
		grupos.setVisibility(View.INVISIBLE);
		pulsadogrupos = new Pulsado("grupos", grupos.getId());
		pulsados.add(pulsadogrupos);

		tresNiveles = (ImageButton) findViewById(R.id.niveles_image);
		tresNiveles.setOnClickListener(new socialTVClick());
		tresNiveles.setVisibility(View.INVISIBLE);
		pulsadotresNiveles = new Pulsado("tresNiveles", tresNiveles.getId());
		pulsados.add(pulsadotresNiveles);

		circulo = (ImageView) findViewById(R.id.circulos_amigos_image);
		circulo.setOnClickListener(new socialTVClick());
		circulo.setVisibility(View.INVISIBLE);
		pulsadocirculo = new Pulsado("circulo", circulo.getId());
		pulsados.add(pulsadocirculo);

		antena = (ImageView) findViewById(R.id.antena_programa_image);
		antena.setOnClickListener(new socialTVClick());
		antena.setVisibility(View.INVISIBLE);
		pulsadoantena = new Pulsado("antena", antena.getId());
		pulsados.add(pulsadoantena);

		global = (ImageView) findViewById(R.id.global_twitter_image);
		global.setOnClickListener(new socialTVClick());
		global.setVisibility(View.INVISIBLE);
		pulsadoglobal = new Pulsado("global", global.getId());
		pulsados.add(pulsadoglobal);

		explicativo = (ImageView) findViewById(R.id.pastilla_image);

		textExplicativo = (TextView) findViewById(R.id.pastilla_text);
		textExplicativo.setVisibility(View.INVISIBLE);

		ImageView flecha1;
		ImageView flecha2;
		ImageView flecha3;
		ImageView flecha4;
		ImageView flecha5;
		ImageView flecha6;
		ImageView flecha7;
		ImageView flecha8;
		ImageView flecha9;
		ImageView flecha10;
		ImageView flecha11;
		ImageView flecha12;
		ImageView flecha13;
		ImageView flecha14;
		ImageView flecha15;
		ImageView flecha16;
		ImageView flecha17;
		ImageView flecha18;
		ImageView flecha19;
		ImageView flecha20;
		ImageView flecha21;
		ImageView flecha22;
		ImageView flecha23;
		ImageView flecha24;
		ImageView flecha25;

		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_portada, menu);
		return true;
	}

	private class socialTVClick implements OnClickListener {

		public void onClick(View v) {

			alphaDown = new AlphaAnimation(1.0f, 0.0f);
			alphaUp = new AlphaAnimation(0.0f, 1.0f);
			alphaDown.setDuration(500);
			alphaUp.setDuration(500);
			alphaDown.setFillAfter(true);
			alphaUp.setFillAfter(true);

			switch (v.getId()) {

			case R.id.socialtv_image:
				if (socialTV.getVisibility() == View.VISIBLE) {

					if (pulsadosocialTV.isPulsado()) {

					} else {
						cadena.startAnimation(alphaUp);
						cadena.setVisibility(View.VISIBLE);
						recomendador.startAnimation(alphaUp);
						recomendador.setVisibility(View.VISIBLE);
						social.startAnimation(alphaUp);
						social.setVisibility(View.VISIBLE);
						usuario.startAnimation(alphaUp);
						usuario.setVisibility(View.VISIBLE);

					}

					pulsadosocialTV.setPulsado(true);

					textExplicativo.setText(R.string.socialtv);
					textExplicativo.startAnimation(alphaUp);
					textExplicativo.setTextSize(12);
				} else {

				}
				break;

			case R.id.recomendador_image:

				textExplicativo.startAnimation(alphaDown);
				if (recomendador.getVisibility() == View.VISIBLE) {

					if (pulsadorecomendador.isPulsado()) {

					} else {
						recomendacionGenerica.startAnimation(alphaUp);
						recomendacionGenerica.setVisibility(View.VISIBLE);
						analisisPatrones.startAnimation(alphaUp);
						analisisPatrones.setVisibility(View.VISIBLE);
					}
					pulsadorecomendador.setPulsado(true);

					textExplicativo.setText(R.string.recomendacion);
					textExplicativo.startAnimation(alphaUp);
				}

				break;

			case R.id.recomendacion_generica_image:

				textExplicativo.startAnimation(alphaDown);
				if (recomendacionGenerica.getVisibility() == View.VISIBLE) {

					if (pulsadorecomendacionGenerica.isPulsado()) {

					} else {

						estrenos.startAnimation(alphaUp);
						estrenos.setVisibility(View.VISIBLE);
						destacados.startAnimation(alphaUp);
						destacados.setVisibility(View.VISIBLE);
						patrocinados.startAnimation(alphaUp);
						patrocinados.setVisibility(View.VISIBLE);
					}
					pulsadorecomendacionGenerica.setPulsado(true);

					textExplicativo.setText(R.string.recomendacion_generica);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.estrenos_image:

				textExplicativo.startAnimation(alphaDown);

				if (estrenos.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.estrenos);
					textExplicativo.startAnimation(alphaUp);

				}
				break;

			case R.id.destacados_image:

				textExplicativo.startAnimation(alphaDown);
				if (estrenos.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.destacados);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.patrocinados_image:

				textExplicativo.startAnimation(alphaDown);

				if (patrocinados.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.patrocinados);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.analisis_patrones_image:

				textExplicativo.startAnimation(alphaDown);
				if (analisisPatrones.getVisibility() == View.VISIBLE) {

					if (pulsadoanalisisPatrones.isPulsado()) {

					} else {

						recomendacionPersonalizadas.startAnimation(alphaUp);
						recomendacionPersonalizadas.setVisibility(View.VISIBLE);
					}
					pulsadoanalisisPatrones.setPulsado(true);
					textExplicativo.setText(R.string.analisis_patrones);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.recomendacion_personalizada_image:

				textExplicativo.startAnimation(alphaDown);
				if (recomendacionPersonalizadas.getVisibility() == View.VISIBLE) {

					if (pulsadorecomendacionPersonalizadas.isPulsado()) {

					} else {
						estilo.startAnimation(alphaUp);
						estilo.setVisibility(View.VISIBLE);
						costumbres.startAnimation(alphaUp);
						costumbres.setVisibility(View.VISIBLE);
					}

					pulsadorecomendacionPersonalizadas.setPulsado(true);
					textExplicativo
							.setText(R.string.recomendacion_personalizada);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.estilo_imagen:

				textExplicativo.startAnimation(alphaDown);

				if (estilo.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.estilo);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.costumbres_usuarios_image:

				textExplicativo.startAnimation(alphaDown);
				if (costumbres.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.costumbres);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.cadena_image:

				textExplicativo.startAnimation(alphaDown);
				if (cadena.getVisibility() == View.VISIBLE) {

					if (pulsadocadena.isPulsado()) {

					} else {

						programas.startAnimation(alphaUp);
						programas.setVisibility(View.VISIBLE);
						guiaTvProgramacion.startAnimation(alphaUp);
						guiaTvProgramacion.setVisibility(View.VISIBLE);
						emision.startAnimation(alphaUp);
						emision.setVisibility(View.VISIBLE);
						checkIn.startAnimation(alphaUp);
						checkIn.setVisibility(View.VISIBLE);
						if (gamification.getVisibility() != View.VISIBLE) {
							gamification.startAnimation(alphaUp);
							gamification.setVisibility(View.VISIBLE);
						}
					}
					pulsadocadena.setPulsado(true);
					textExplicativo.setText(R.string.cadena);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.guiatv_programacion_image:

				textExplicativo.startAnimation(alphaDown);
				if (guiaTvProgramacion.getVisibility() == View.VISIBLE) {

					if (pulsadoguiaTvProgramacion.isPulsado()) {

					} else {
						canalesFavoritos.startAnimation(alphaUp);
					}
					pulsadoguiaTvProgramacion.setPulsado(true);

					textExplicativo.setText(R.string.guiatv_programacion);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.canales_favoritos_image:

				textExplicativo.startAnimation(alphaDown);
				if (canalesFavoritos.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.canales_favoritos);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.programas_image:

				textExplicativo.startAnimation(alphaDown);
				if (programas.getVisibility() == View.VISIBLE) {

					if (pulsadoprogramas.isPulsado()) {

					} else {
						informacion.startAnimation(alphaUp);
						informacion.setVisibility(View.VISIBLE);
						guiaCapitulos.startAnimation(alphaUp);
						guiaCapitulos.setVisibility(View.VISIBLE);
						avances.startAnimation(alphaUp);
						avances.setVisibility(View.VISIBLE);
					}
					pulsadoprogramas.setPulsado(true);
					textExplicativo.setText(R.string.programas);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.informacion_image:

				textExplicativo.startAnimation(alphaDown);
				if (informacion.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.informacion);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.guia_capitulos_image:

				textExplicativo.startAnimation(alphaDown);
				if (guiaCapitulos.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.guia_capitulos);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.contenidos_image:

				textExplicativo.startAnimation(alphaDown);
				if (avances.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.avances);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.emision_actual_image:

				textExplicativo.startAnimation(alphaDown);
				if (emision.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.emision);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.checkin_image:

				textExplicativo.startAnimation(alphaDown);
				if (checkIn.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.checkin);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;
			case R.id.gamification_image:

				textExplicativo.startAnimation(alphaDown);
				if (gamification.getVisibility() == View.VISIBLE) {

					if (pulsadogamification.isPulsado()) {

					} else {
						registroVisualizacionJuego.startAnimation(alphaUp);
						registroVisualizacionJuego.setVisibility(View.VISIBLE);
						nivelesPuntos.startAnimation(alphaUp);
						nivelesPuntos.setVisibility(View.VISIBLE);
						retos.startAnimation(alphaUp);
						retos.setVisibility(View.VISIBLE);
					}
					pulsadogamification.setPulsado(true);
					textExplicativo.setText(R.string.gamification);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.registro_visualizacion_juego_image:

				textExplicativo.startAnimation(alphaDown);
				if (registroVisualizacionJuego.getVisibility() == View.VISIBLE) {

					textExplicativo
							.setText(R.string.registro_visualizacion_juego);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.retos_image:

				textExplicativo.startAnimation(alphaDown);
				if (retos.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.retos);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.puntos_niveles_image:

				textExplicativo.startAnimation(alphaDown);
				if (nivelesPuntos.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.niveles_puntos);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.usuario_image:

				textExplicativo.startAnimation(alphaDown);
				if (usuario.getVisibility() == View.VISIBLE) {
					if (pulsadousuario.isPulsado()) {

					} else {
						checkInUser.startAnimation(alphaUp);
						checkInUser.setVisibility(View.VISIBLE);
						favoritos.startAnimation(alphaUp);
						favoritos.setVisibility(View.VISIBLE);
						alarmas.startAnimation(alphaUp);
						alarmas.setVisibility(View.VISIBLE);
						registroVisualizacion.startAnimation(alphaUp);
						registroVisualizacion.setVisibility(View.VISIBLE);

						if (gamification.getVisibility() != View.VISIBLE) {
							gamification.startAnimation(alphaUp);
							gamification.setVisibility(View.VISIBLE);
						}

						if (grupos.getVisibility() != View.VISIBLE) {
							grupos.startAnimation(alphaUp);
							grupos.setVisibility(View.VISIBLE);
						}

					}
					pulsadousuario.setPulsado(true);
					textExplicativo.setText(R.string.usuario);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;
			case R.id.check_in_user_image:

				textExplicativo.startAnimation(alphaDown);
				if (checkInUser.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.checkinuser);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.favorito_image:

				textExplicativo.startAnimation(alphaDown);
				if (favoritos.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.favoritos);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.alarmas_image:

				textExplicativo.startAnimation(alphaDown);
				if (alarmas.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.alarmas);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.registro_visualizacion_image:

				textExplicativo.startAnimation(alphaDown);
				if (registroVisualizacion.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.registro_visualizacion);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.social_image:

				textExplicativo.startAnimation(alphaDown);
				if (social.getVisibility() == View.VISIBLE) {
					if (pulsadosocial.isPulsado()) {

					} else {
						geolocalizacion.startAnimation(alphaUp);
						geolocalizacion.setVisibility(View.VISIBLE);
						circulosEmisionRecepcion.startAnimation(alphaUp);
						circulosEmisionRecepcion.setVisibility(View.VISIBLE);

						if (grupos.getVisibility() != View.VISIBLE) {
							grupos.startAnimation(alphaUp);
							grupos.setVisibility(View.VISIBLE);
						}
					}

					pulsadosocial.setPulsado(true);
					textExplicativo.setText(R.string.social);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.geolocalizacion_image:

				textExplicativo.startAnimation(alphaDown);
				if (geolocalizacion.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.geolocalizacion);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.circulos_emision_recepcion_image:

				textExplicativo.startAnimation(alphaDown);
				if (circulosEmisionRecepcion.getVisibility() == View.VISIBLE) {

					textExplicativo
							.setText(R.string.circulos_emision_recepcion);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.grupos_image:

				textExplicativo.startAnimation(alphaDown);
				if (grupos.getVisibility() == View.VISIBLE) {
					if (pulsadogrupos.isPulsado()) {

					} else {
						tresNiveles.startAnimation(alphaUp);
						tresNiveles.setVisibility(View.VISIBLE);

					}
					pulsadogrupos.setPulsado(true);
					textExplicativo.setText(R.string.grupos);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.niveles_image:

				textExplicativo.startAnimation(alphaDown);
				if (tresNiveles.getVisibility() == View.VISIBLE) {

					if (pulsadotresNiveles.isPulsado()) {

					} else {
						circulo.startAnimation(alphaUp);
						circulo.setVisibility(View.VISIBLE);
						antena.startAnimation(alphaUp);
						antena.setVisibility(View.VISIBLE);
						global.startAnimation(alphaUp);
						global.setVisibility(View.VISIBLE);

					}
					pulsadotresNiveles.setPulsado(true);
					textExplicativo.setText(R.string.niveles);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.circulos_amigos_image:

				textExplicativo.startAnimation(alphaDown);
				if (circulo.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.circulo);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.antena_programa_image:

				textExplicativo.startAnimation(alphaDown);
				if (antena.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.antena);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			case R.id.global_twitter_image:

				textExplicativo.startAnimation(alphaDown);
				if (global.getVisibility() == View.VISIBLE) {

					textExplicativo.setText(R.string.global);
					textExplicativo.startAnimation(alphaUp);
				} else {

				}
				break;

			}

		}
	}

}
